<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-show</title>
</head>

<body>
    <div id="app">
        <input type="button" value="切换显示状态" @click="changeIsshow">
        <img v-show="isShow" src="./image//wa1.jpg" alt="">

        <input type="button" value="累加年龄" @click="addAge">
        <img v-show="age>=18" src="./image//wa1.jpg " alt="">
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

    <script>
        var app = new Vue({
            el: "#app",
            data: {
                isShow: false,
                age: 16
            },
            methods: {
                changeIsshow: function () {
                    this.isshow = !this.isshow;
                },
                addAge() {
                    this.age++;
                }

            }
        })
    </script>

</body>

</html>